import time
def start(massiv, N):
    a=m1
    for i in range (N-1):
        for j in range(N-i-1):
            if a[j] > a[j+1]:
                a[j], a[j+1] = a[j+1], a[j]
    
def read(filename):    
	file = open(filename, 'r')    
	data = file.readlines()    
	return data

m1 = read("m1_sorted.txt")
razmer = len(m1) 
t_start = time.time() 
start(m1, razmer) 
t_finish = time.time() 
print("sorted.txt ",round((t_finish-t_start)*1000),"milliseconds")

m2 = read("m2_reverse.txt")
razmer = len(m2) 
t_start = time.time() 
start(m2, razmer) 
t_finish = time.time() 
print("reverse.txt",round((t_finish-t_start)*1000),"milliseconds")

m3 = read("m3_shuffle.txt")
razmer = len(m3) 
t_start = time.time() 
start(m3, razmer) 
t_finish = time.time() 
print("shuffle.txt ",round((t_finish-t_start)*1000),"milliseconds")


